Skip to content

Conversation

martijnvans
Copy link
Contributor

@martijnvans martijnvans commented Oct 7, 2025

This PR adds support for a new testing mode, in which test setup creates multiple projects and service accounts, and each module's tests run in these projects, isolated from one another. This is to allow the projects to have separate services enabled, and to allow the service accounts to have different permissions enabled.

An example of how this would be used in a specific repo is here: https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/pull/408/files.

Unfortunately, I didn't see a simpler way to acoomplish the task of "searching for all modules currently being tested" than doing a graph search over modules. This diagram illustrates the possibilities of which modules could reference which other modules, and the graph traversal needs to be able to handle all of those cases:

graph of modules referencing other modules

The current implementation relies on module-swapper having been run before tests are run. If not, and the test setup has been migrated over to isolated projects, running tests will fail with a "project_id was not supplied" error.

@martijnvans martijnvans marked this pull request as ready for review October 7, 2025 19:59
@apeabody
Copy link
Collaborator

apeabody commented Oct 7, 2025

/gcbrun

@apeabody
Copy link
Collaborator

/gcbrun

Copy link
Collaborator

@apeabody apeabody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @martijnvans!

@apeabody
Copy link
Collaborator

This will go into #3189

@apeabody apeabody merged commit 6a4fa54 into GoogleCloudPlatform:main Oct 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants